\chapter{Calculation of magnetic properties}\label{ch:magnetic}

This chapter describes the calculation of properties depending on
magnetic fields, both as created by an external magnetic field as well
as the magnetic field created by a nuclear magnetic moment.
This includes the two
contributions to the ordinary spin-Hamiltonian used in NMR, nuclear
shieldings\index{nuclear shielding} and indirect nuclear spin--spin
couplings\index{spin-spin coupling!indirect} constants. We
also describe the calculation of the magnetic analogue of the
polarizability, the molecular
magnetizability\index{magnetizability}. This property
is of importance in NMR experiments where the reference substance is placed
in another tube than the sample. We also shortly describe
two properties very closely related to the magnetizability and nuclear
shieldings, respectively, the rotational {\em g} factor\index{rotational g factor}
and the nuclear spin--rotation constants\index{spin--rotation constant}.

Three properties that in principle depend on the %nuclear
magnetic moments are
not treated here, namely the properties associated with optical
activity or, more precisely, with circular dichroism. These
properties are Vibrational Circular Dichroism
(VCD)\index{VCD}\index{vibrational circular dichroism}, Raman
Optical activity (ROA)\index{ROA}\index{Raman optical activity} and
Electronic Circular Dichroism (ECD)\index{ECD}\index{electronic
circular dichroism} and these properties will be treated in
Chapter~\ref{ch:optchap}.
Another (magneto-)optical property, the ${\cal{B}}$ term of
Magnetic Circular Dichroism (MCD) will be described in
Chapter~\ref{ch:rspchap}.

Gauge-origin\index{gauge origin independence!London orbitals}
independent nuclear shieldings,
magnetizabilities and rotational {\em g} tensors are
obtained through the use of London atomic orbitals, and the theory is
presented in several references
\cite{kwjfhppjacs112,krthrkpjklbhjajjcp100,krthklbpjhjajjcp99,krthklbpjjocp195}.
Gauge-origin\index{gauge origin independence!CTOCD} independent nuclear shieldings and
magnetizabilities can also be obtained by using the
the Continuous Transformation of the Origin of the Current Density method (CTOCD)
\index{Continuous Transformation of the Origin of the Current Density}
\index{CTOCD-DZ} approach~\cite{paololazz1,paololazz2,ctocd}. In the present
version of \dalton\ the CTOCD-DZ method is implemented and can be invoked by
the keyword \Key{CTOCD} in the \Sec{*PROPERTIES} input module.
More detailed information on CTOCD-DZ calculations can be found in section
\ref{sec:ctocdgeneral}.


The indirect spin--spin couplings are calculated by using the triplet linear
response function\index{triplet response}, as described in
Ref.~\cite{ovhapjhjajsbpthjcp96}.
These are in principle equally simple to calculate with \dalton\ as
nuclear shieldings and magnetizabilities. However, there are 10
contributions to the spin--spin coupling constant from {\em each}
nucleus.\footnote{\dalton\ now only calculates the symmetry-distinct
  contributions to the spin--dipole operator, that is---six instead of
  nine elements are calculated for this operator.} Furthermore, the
spin--spin coupling constants put severe
requirements on the quality of the basis set as well as a proper
treatment of correlation, making the evaluation of spin--spin coupling
constants a time consuming task. Some notes about how this time
can be reduced is given below.

Second Order Polarization Propagator Approximation (SOPPA) \index{SOPPA}
\index{polarization propagator}
\cite{esnpjjodjcp73,jopjdycpr2,mjpekdtehjajjojcp,spascpl260,tejospastcan100},
SOPPA(CC2) \index{SOPPA(CC2)} \cite{spas097} or SOPPA(CCSD)
\index{SOPPA(CCSD)} \cite{soppaccsd,spascpl260,tejospastcan100}
calculations of the indirect spin--spin couplings, nuclear shieldings,
magnetizabilities, rotational {\em g} tensors and the nuclear
spin--rotation constants can be invoked by the additional keywords
\Key{SOPPA} or \Key{SOPPA(CCSD)} in the \Sec{*PROPERTIES} input module.
This requires for SOPPA that the MP2 energy was calculated by
specifying the keyword \Key{MP2} in the \Sec{*WAVE FUNCTIONS} input
module, whereas for a SOPPA(CC2) or SOPPA(CCSD) calculation the CC2 or
CCSD amplitudes have to be generated by specifying the keyword \Key{CC}
in the \Sec{*WAVE FUNCTIONS} input module and \Key{SOPPA2} or
\Key{SOPPA(CCSD)} in the \Sec{CC INPUT} section. The use of London
orbitals is automatically disabled in SOPPA calculations of the nuclear
shieldings, magnetizabilities and rotational {\em g} tensors.

\section{Magnetizabilities}\label{sec:magnetizability}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item SCF magnetizabilities: K.Ruud, T.Helgaker, K.L.Bak, P.J\o rgensen and H.J.Aa.Jensen. \newblock {\em J.Chem.Phys.}, {\bf 99},\hspace{0.25em}3847, (1993).
\item MCSCF magnetizabilities: K.Ruud, T.Helgaker, K.L.Bak, P.J\o
rgensen, and J.Olsen. \newblock {\em Chem.Phys.}, {\bf
195},\hspace{0.25em}157, (1995).
\item Solvent effects: K.V.Mikkelsen,
P.J{\o}rgensen, K.Ruud, and T.Helgaker. \newblock {\em J.Chem.Phys.}, {\bf
107},\hspace{0.25em}1170, (1997).
\item CTOCD-DZ magnetizabilities: P.Lazzeretti, M.Malagoli and R.Zanasi.
 \newblock {\em Chem.Phys.Lett.}, {\bf 220},\hspace{0.25em}299, (1994)
\end{list}
}}
\end{center}

The calculation of molecular magnetizabilities\index{magnetizability}
is invoked by the
keyword \Key{MAGNET} in the \Sec{*PROPERTIES} input module. Thus
a complete input file for the calculation of molecular
magnetizabilities will look like:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.MAGNET
**END OF DALTON INPUT
\end{verbatim}

This will invoke the calculation of molecular magnetizabilities using
London Atomic Orbitals\index{London orbitals} to ensure fast basis set
convergence and
gauge-origin\index{gauge origin independence!London orbitals} independent results.
The natural connection\index{natural connection}
\cite{joklbkrthpjtca90} is used in order to get numerically accurate
results. By default the center of mass\index{gauge origin!center of mass} is chosen
as gauge origin.

For a SOPPA\index{SOPPA}, SOPPA(CC2)\index{SOPPA(CC2)} or
SOPPA(CCSD)\index{SOPPA(CCSD)} calculation of molecular
magnetizabilities the additional keywords \Key{SOPPA} or
\Key{SOPPA(CCSD)} have to be specified in the \Sec{*PROPERTIES} input
module. For SOPPA an MP2 calculation has to be requested by the keyword
\Key{MP2} in the \Sec{*WAVE FUNCTIONS} input module, whereas for
SOPPA(CC2) or SOPPA(CCSD) a CC2 or CCSD calculation has to be requested
by the keyword \Key{CC} in the \Sec{*WAVE
  FUNCTIONS} input module with the \Sec{CC INPUT} option
\Key{SOPPA2} or \Key{SOPPA(CCSD)}. This will also automatically disable
the use of London orbitals.

For a CTOCD-DZ\index{CTOCD-DZ} calculation of molecular
magnetizabilities, the additional keyword \Key{CTOCD} has to be
specified in the \Sec{*PROPERTIES} input module. This will
automatically disable the use of London orbitals. \Key{SOPPA} /
\Key{SOPPA(CCSD)} and \Key{CTOCD} could be used together to get SOPPA /
SOPPA(CC2) / SOPPA(CCSD) molecular magnetizabilities using the CTOCD-DZ
formalism. Information about suitable basis sets for CTOCD-DZ
calculations can be found in the section \ref{sec:ctocdgeneral}.

The augmented cc-pVXZ basis sets of Dunning and
coworkers~\cite{thdjcp90,rakthdrjhjcp96,dewthdjcp98,dewthdjcp100} have
been shown to give  to give excellent results for
magnetizabilities~\cite{krthklbpjhjajjcp99,krthpjklbcpl223,krhsthklbpjjacs116},
and these basis sets are obtainable from the basis set library.

Notice that a general print level of 2 or higher is needed in order to
get the individual contributions (relaxation, one- and
two-electron expectation values and so on) to the total magnetizability.

If more close control of the different parts of the calculation of the
magnetizability is wanted, we refer the reader to the section
describing the options available. The modules that controls the
calculation of molecular magnetizabilities are:

\begin{list}{}{\itemsep 0.10cm \parsep 0.0cm}
\item[\Sec{EXPECT}] Controls the calculation of one-electron
expectation values contributing to the diamagnetic magnetizability.
\item[\Sec{RHSIDE}] Controls the set up of the right-hand sides
(gradient terms) as well as the calculation of two-electron
expectation values and reorthonormalization terms.
\item[\Sec{LINRES}] Controls the solution of the magnetic response
equations
\item[\Sec{RELAX}] Controls the multiplication of solution and right-hand
side vectors into relaxation contributions
\end{list}

\section{Nuclear shielding constants}\label{sec:shieldings}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item K.Wolinski, J.F.Hinton, and P.Pulay. \newblock {\em
J.Am.Chem.Soc.}, {\bf 112},\hspace{0.25em}8251, (1990)
\item K.Ruud, T.Helgaker, R.Kobayashi, P.J\o rgensen, K.L.Bak, and H.J.Aa.Jensen.
\newblock {\em J.Chem.Phys.}, {\bf 100},\hspace{0.25em}8178, (1994).
\item Solvent effects: K.V.Mikkelsen,
P.J{\o}rgensen, K.Ruud, and T.Helgaker. \newblock {\em J.Chem.Phys.}, {\bf
107},\hspace{0.25em}1170, (1997).
\item DFT nuclear shieldings: T.Helgaker, P.J.Wilson, R.D.Amos, and N.C.Handy.
\newblock {\em J.Chem.Phys.}, {\bf 113},\hspace{0.25em}2983, (2000).
\item CTOCD-DZ nuclear shielding: A.Ligabue, S.P.A.Sauer, P.Lazzeretti.
\newblock {\em J.Chem.Phys.}, {\bf 118},\hspace{0.25em}6830, (2003).
\end{list}
}}
\end{center}


The calculation of nuclear shieldings\index{NMR!shielding}\index{nuclear shielding} are
invoked by the
keyword \Key{SHIELD} in the \Sec{*PROPERTIES} input module. Thus
a complete input file for the calculation of nuclear shieldings will
be:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.SHIELD
**END OF DALTON INPUT
\end{verbatim}

This will invoke the calculation of nuclear shieldings using
London Atomic Orbitals\index{London orbitals} to ensure fast basis set
convergence and gauge
origin\index{gauge origin} independent results. The natural connection
\cite{joklbkrthpjtca90}\index{natural connection}
is used in order to get
numerically accurate results. By default the center of mass is chosen as gauge
origin\index{center of mass}.

For a SOPPA\index{SOPPA}, SOPPA(CC2)\index{SOPPA(CC2)} or
SOPPA(CCSD)\index{SOPPA(CCSD)} calculation of nuclear shieldings the
additional keywords \Key{SOPPA} or \Key{SOPPA(CCSD)} have to be
specified in the \Sec{*PROPERTIES} input module. For SOPPA an MP2
calculation has to be requested by the keyword \Key{MP2} in the
\Sec{*WAVE FUNCTIONS} input module, whereas for SOPPA(CC2) or
SOPPA(CCSD) a CC2 or CCSD calculation has to be requested by the
keyword \Key{CC} in the \Sec{*WAVE
  FUNCTIONS} input module with the \Sec{CC INPUT} option
\Key{SOPPA2} or \Key{SOPPA(CCSD)}. This will also automatically disable
the use of London orbitals.



For a CTOCD-DZ\index{CTOCD-DZ} calculation of nuclear shieldings the
additional keyword \Key{CTOCD} has to be specified in the
\Sec{*PROPERTIES} input module. This will automatically disable the use
of London orbitals. \Key{SOPPA} / \Key{SOPPA} and \Key{CTOCD} could be
used together to get gauge origin independent SOPPA / SOPPA(CC2) /
SOPPA(CCSD) nuclear shieldings using the CTOCD-DZ formalism.
Information about suitable basis set for CTOCD-DZ calculations can be
found in the section \ref{sec:ctocdgeneral}.

A basis set well suited for the calculation of nuclear shieldings is
the TZ basis set of Ahlrichs and
coworkers~\cite{ashhrajcp97,aschrajcp100} with two polarization
functions~\cite{thmjkrcr99}. This basis set is available from the basis
set library as TZ2P. The pcs-n basis sets of Jensen
\cite{bs08-jctc4-719} are specially optimized for DFT calculations of
nuclear shieldings. These basis sets are also available from the basis
set library.

Notice that a general print level of 2 or higher is needed in order to
get the individual contributions (relaxation, one- and
two-electron expectation values and so on) to the total nuclear shieldings.

If more close control of the different parts of the calculation of the
nuclear shieldings is wanted we refer the reader to the section
describing the options available. For the calculation of nuclear
shieldings, these are the same as listed above for magnetizability
calculations.


%------------------------------------------------------------
% by jmelo May-2013

\section{Relativistic corrections to Nuclear shielding constants}\label{sec:lresc}

Linear Response Elimination of Small Component scheme (LRESC) provides the calculation
of first and second order relativistic corrections to nuclear shielding constants. 
This corrections are invoked through the keyword \Key{LRESC} on the \Sec{*PROPERTIES} input module. Detailed description of the LRESC theoretical scheme and discussions are on this papers. 

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item J.I. Melo, M.C. Ruiz de Azua, C.G Giribet, G.A. Aucar, and R.H. Romero \newblock {\em J. Chem. Phys.}, {\bf 118},\hspace{0.25em}2, (2003).

\item M.C.Ruiz de Azua, J.I. Melo, and C.G Giribet \newblock {\em Mol. Phys.}, {\bf 101},\hspace{0.25em}20, (2003).

\item J.I. Melo, M.C.Ruiz de Azua, C.G Giribet, G.A. Aucar and P.F. Provasi \newblock {\em J.Chem.Phys.}, {\bf 121},\hspace{0.25em}14, (2004).

\item P.G. Roura, J.I. Melo, M.C.Ruiz de Azua, and C.G Giribet \newblock {\em J.Chem.Phys.}, {\bf 125},\hspace{0.25em}064107, (2006).
\end{list}
}}
\end{center}

LRESC module computes all first and second order (singlet and triplet) corrections to nuclear magnetic shielding constant of a specific nucleus in a molecule. 
Third order corrections are not included in the present version of the code, anyway they can be computed via \Sec{*RESPONSE} module (see \Sec{Quadratic Response}, \ref{subsec:quadrsp}). Namely spin orbit correction to shielding constants and paramagnetic third order scalar terms (Darwin and Massvelo). A complete input file for the calculation within LRESC corrections to shielding constant is thus :

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**INTEGRLAS 
.LR-SHI  ! mandatory, to have all necessary integrals computed to use in LRESC module.
**WAVE FUNCTIONS
.HF
**PROPERTIES
.LR-SHI
**END OF DALTON INPUT
\end{verbatim}

The integrals computed under \Key{LRINTS} are described in INTEGRALS chapter Section \ref{sec:herinp}

There are a few keywords to get more control over the output and the amount of corrections to be calculated. A detailed physical description on each correction can be found in Ref.~\cite{melomaldojcp12}. Regarding basis sets convergence, benchmark calculations where presented on Ref.~\cite{melomaldojcp12},~\cite{melomaldotca11},~\cite{melojcp03} . The complete list of control keywords are:

\begin{list}{}{\itemsep 0.10cm \parsep 0.0cm}
\item[\Key{PRINT}] Controls the print level, for debugging purpose.
\item[\Key{SELECT}] Select the atom to which LRESC corrections will be calculated. Default is 1, first atom in input list (.mol file).
\item[\Key{PRTALL}] Full output of individual LRESC corrections will be prompted in output file. If not, only the total Paramagnetic and Diamagnetic corrections are printed. Depending on whether you asked for all or just some of LRESC corrections (see next keywords).
\item[\Key{PARA1S}] Only Paramagnetic Singlet First order corrections are calculated 
\item[\Key{PARA1T}] Only Paramagnetic Triplet First order corrections are calculated 
\item[\Key{PARA3S}] (not implemented yet) Only Paramagnetic Singlet Third order corrections are calculated. 
\item[\Key{PARA3T}] (not implemented yet) Only Paramagnetic Triplet Third order corrections are calculated. 
\item[\Key{DIAM0S}] Only Diamagnetic Singlet Zeroth order corrections are calculated
\item[\Key{DIAM1S}] Only Diamagnetic Singlet First order corrections are calculated 
\end{list}


Default Values, and some tips for better running:

\begin{center}
\begin{itemize}{}{}
\item First Atom on input list is selected, unless specified with \Key{SELECT}. 
\item Center of Mass gauge origin for atomic integrals. As mentioned, \Key{GAUGEO} on 
\Sec{*INTEGRALS} must be placed in the position of the selected nucleus. Default value is the center of mass.
\item All LRESC terms will be calculated, unless some (or more) of them are asked for : PARA1S, PARA1T, DIAM0S and/or DIAM1S. See example below.
\item Uncontracted basis set is recommended. 
\item No symmetry for molecule specification. 
\item Hartree-Fock and DFT schemes supported for the ground state Wave Function.
\end{itemize}
\end{center}


\begin{verbatim}
(...)
*INTEGRALS
.LR-SHI
.GAUGEO 
a b c        ! a b c atomic cartesian coordinates of selected nucleus (in a.u.)
(...)
**PROPERTIES
.LR-SHI
*LROPTS
.PRTALL      ! detailed output on individual corrections
.PRINT
JIMPRT       ! reads one integer , for debugging
.SELECT
LRATOM       ! reads one integer corresponding to the order of selected nucleus list on input file 
.DIAM0S      ! calculation of diamagnetic  zeroth order terms
.DIAM1S      ! calculation of diamagnetic  first order terms
.PARA1S      ! calculation of paramagnetic first(singlet) order terms
.PARA1T      ! calculation of paramagnetic first(triplet) order terms
**END OF DALTON INPUT
\end{verbatim}





%------------------------------------------------------------

\section{Rotational {\em g} tensor}\label{sec:gfac}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item J.Gauss, K.Ruud, and T.Helgaker. \newblock {\em J.Chem.Phys.},
{\bf 105},\hspace{0.25em}2804, (1996).
\end{list}
}}
\end{center}

The calculation of the rotational  {\em g} tensor\index{rotational g
tensor} is invoked through the
keyword \Key{MOLGFA} in the \Sec{*PROPERTIES} input module. A complete
input file for the calculation of the molecular g tensor is thus:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.MOLGFA
**END OF DALTON INPUT
\end{verbatim}

The molecular g tensor consists of two terms: a nuclear term and a
term which may be interpreted as one definition of a paramagnetic part
of the magnetizability tensor as
described in Ref.~\cite{jgkrthjcp105}.
By default the center of mass\index{center of mass} is chosen as
rotational origin, as this corresponds to the point about which the
molecule rotates. The use of
rotational London atomic\index{London orbitals}
orbitals can be turned off through
the keyword \verb|.NOLOND|.

For a SOPPA\index{SOPPA}, SOPPA(CC2)\index{SOPPA(CC2)} or
SOPPA(CCSD)\index{SOPPA(CCSD)} calculation of rotational  {\em g}
tensors the additional keywords \Key{SOPPA} or \Key{SOPPA(CCSD)} have
to be specified in the \Sec{*PROPERTIES} input module. For SOPPA an MP2
calculation has to be requested by the keyword \Key{MP2} in the
\Sec{*WAVE FUNCTIONS} input module, whereas for SOPPA(CC2) or
SOPPA(CCSD) a CC2 or CCSD calculation has to be requested by the
keyword \Key{CC} in the \Sec{*WAVE
  FUNCTIONS} input module with the \Sec{CC INPUT} option
\Key{SOPPA2} or \Key{SOPPA(CCSD)}. This will also automatically disable
the use of London orbitals.


The basis set requirements for the rotational {\em g} tensors are more or
less equivalent with the ones for the molecular magnetizability,
that is, the augmented cc-pVDZ of Dunning and
Woon~\cite{thdjcp90,dewthdjcp98}, available from the basis set library
as \verb|aug-cc-pVDZ|.

If more close control of the different parts of the calculation of the
rotational {\em g}  tensor is wanted we refer the reader to the section
describing the options available. For the calculation of the molecular
g tensor, these are the same as listed above for magnetizability
calculations.

\section{Nuclear spin--rotation constants}\label{sec:spinrotasjon}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item R.Ditchfield. \newblock {\em J.Chem.Phys.}, {\bf
56},\hspace{0.25em}5688 (1972)
\item J.Gauss, K.Ruud, and T.Helgaker. \newblock {\em J.Chem.Phys.},
{\bf 105},\hspace{0.25em}2804, (1996).
\end{list}
}}
\end{center}


In \dalton\ the nuclear spin--rotation\index{spin-rotation constant}
constants are calculated using
rotational orbitals, giving an improved
basis set convergence~\cite{jgkrthjcp105}. We use the
expression for the spin--rotation constant where the paramagnetic term
is evaluated around the center of mass, and thus will only solve three
response equations at the most.

An input requesting the calculation of spin--rotation constants will
look like

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.SPIN-R
**END OF DALTON INPUT
\end{verbatim}

As the nuclear spin--rotation\index{spin-rotation constant} constants
depend on the isotopic substitution of
the molecule, both through the nuclear magnetic moments and through the
center of mass, the isotopic constitution need to be specified if this
is different  from the most abundant isotopic constitution. Note that
some of the most common isotopes do not have a magnetic moment. The isotope can be chosen by the keyword \verb|Isotope=| in the \molinp\ file.

For a SOPPA\index{SOPPA}, SOPPA(CC2)\index{SOPPA(CC2)} or
SOPPA(CCSD)\index{SOPPA(CCSD)} calculation of nuclear spin--rotation
constants the additional keywords \Key{SOPPA} or \Key{SOPPA(CCSD)} have
to be specified in the \Sec{*PROPERTIES} input module. For SOPPA an MP2
calculation has to be requested by the keyword \Key{MP2} in the
\Sec{*WAVE FUNCTIONS} input module, whereas for SOPPA(CC2) or
SOPPA(CCSD) a CC2 or CCSD calculation has to be requested by the
keyword \Key{CC} in the \Sec{*WAVE
  FUNCTIONS} input module with the \Sec{CC INPUT} option
\Key{SOPPA2} or \Key{SOPPA(CCSD)}. This will also automatically disable
the use of London orbitals.

We note that in the current release of \dalton, nuclear spin--rotation
constants cannot be calculated employing symmetry-dependent nuclei.
Thus for a molecule like N$_2$, the symmetry plane perpendicular to the
molecular bond will have to be removed during the calculation.

\section{Indirect nuclear spin--spin coupling
constants}\label{sec:spinspin}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item O.Vahtras, H.\AA gren, P.J\o rgensen, H.J.Aa.Jensen, S.B.Padkj\ae
r, and T.Helgaker. \newblock {\em J.Chem.Phys.}, {\bf
96},\hspace{0.25em}6120, (1992).
\item Solvent effects: P.-O.\AA strand, K.V.Mikkelsen, P.J{\o}rgensen,
K.Ruud and T.Helgaker.  \newblock {\em J.Chem.Phys.}, {\bf
108},\hspace{0.25em}2528, (1998)
\item SOPPA and SOPPA(CCSD): T.Enevoldsen, J.Oddershede, and S.P.A. Sauer.
\newblock {\em Theor.~Chem.~Acc.}, {\bf 100},\hspace{0.25em}275, (1998)
\item SOPPA(CC2): H.Kj{\ae}r, S.P.A.Sauer, and J.Kongsted.
\newblock {\em J.Chem.Phys.}, {\bf 133},\hspace{0.25em}144106, (2010)
\item DFT: T.Helgaker, M.Watson, and N.C.Handy
\newblock {\em J.Chem.Phys.}, {\bf 113},\hspace{0.25em}9402, (2000)
\end{list}
}}
\end{center}

As mentioned in the introduction of this chapter, the calculation of
indirect nuclear
spin--spin coupling constants is a time consuming task due to the
large number of contributions to the total spin---spin coupling
constant. Still, if all spin---spin couplings\index{spin-spin
coupling} in a molecule are wanted,
with some restrictions mentioned below, the input will look as
follows:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.SPIN-SPIN
.TDA TRIPLET
**END OF DALTON INPUT
\end{verbatim}

This input will calculate the indirect nuclear spin--spin
coupling\index{spin-spin coupling}
constants between isotopes with non-zero magnetic
moments\index{magnetic moment} and a
natural abundance\index{abundance} of more than 1\% . This limit will
automatically
include proton and $^{13}$C spin--spin coupling constants. By default,
all contributions to the coupling constants will be calculated.
The Tamm-Dancoff approximation (TDA) will be used for the triplet response contributions
(Fermi-contact and spin-dipole).

Often one is interested in only certain kinds of nuclei. For example,
 one may want to calculate only the proton spin--spin couplings of a molecule.
This can be accomplished in two ways: either by changing the abundance
threshold so that only this single isotope is included (most useful
for proton couplings), or by selecting the particular nuclei of interest.

For a SOPPA\index{SOPPA}, SOPPA(CC2)\index{SOPPA(CC2)} or
SOPPA(CCSD)\index{SOPPA(CCSD)} calculation of indirect nuclear
spin--spin coupling constants the additional keywords \Key{SOPPA} or
\Key{SOPPA(CCSD)} have to be specified in the \Sec{*PROPERTIES} input
module. For SOPPA an MP2 calculation has to be requested by the keyword
\Key{MP2} in the \Sec{*WAVE FUNCTIONS} input module, whereas for
SOPPA(CC2) or SOPPA(CCSD) a CC2 or CCSD calculation has to be requested
by the keyword \Key{CC} in the \Sec{*WAVE
  FUNCTIONS} input module with the \Sec{CC INPUT} option
\Key{SOPPA2} or \Key{SOPPA(CCSD)}.

All the keywords necessary to control such adjustments to the
calculation is given in the section describing the input for the
\Sec{SPIN-S} submodule. An input in which we  have reduced the
abundance threshold as well as selected three atoms will look as:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.SPIN-S
.TDA TRIPLET
*SPIN-S
.ABUNDA
 0.10
.SELECT
    3
    2    4    5
**END OF DALTON INPUT
\end{verbatim}

We refer to the section describing the \Sec{SPIN-S} input module for
the complete description of the syntax for these keywords, as well as
the numbering of the atoms which are selected.

We also notice that it is often of interest to calculate only specific
contributions (usually the Fermi-contact\index{Fermi contact} contribution) at a high level
of approximation. Sometimes the results obtained with a Hartree--Fock
wave function may help in predicting the relative importance of the different
contributions, thus helping in the decision of which contributions
should be calculated at a correlated level \cite{krthklbpjcpl226}.
The calculation of only certain contributions can be accomplished in
the input by turning off the different
contributions by the keywords \Key{NODSO}, \Key{NOPSO},
\Key{NOSD}, and \Key{NOFC}. We refer to the description of the
\Sec{SPIN-S} input module for a somewhat more thorough discussion.

Accurate calculations of indirect nuclear spin--spin coupling constants
require specialized basis sets. Basis set well suited for the
calculation of indirect nuclear spin--spin coupling constants are the
pcJ-n and ccJ-pVXZ basis sets of Jensen and co-workers
\cite{nmr06-jctc2-1360,bs10-tca126-371,nmr08-jcp129-064111}  or the
aug-cc-pVTZ-J basis sets of Sauer and co-workers
\cite{tejospastcan100,pfpgaaspasjcp115,spas058,spas091,spas096}. These
basis sets are available from the basis set library.


If a closer a control of the individual parts of the calculation of
indirect nuclear spin--spin coupling constants is wanted, this can be
done through the use of keywords in the following input modules:

\begin{list}{}{\itemsep 0.10cm \parsep 0.0cm}
\item[\Sec{EXPECT}] Controls the calculation of one-electron
expectation value contribution to the diamagnetic spin--spin coupling
constants.
\item[\Sec{RHSIDE}] Controls the set up of the right-hand sides
(gradient terms).
\item[\Sec{LINRES}] Controls the solution of the singlet magnetic
response equations.
\item[\Sec{TRPRSP}] Controls the solution of the triplet magnetic
response equations (for Fermi-contact and spin--dipole contributions).
\item[\Sec{RELAX}] Controls the multiplication of solution and right hand
side vectors into relaxation contributions.
\item[\Sec{SPIN-S}] Controls the choice of nuclei for which the
spin--spin coupling constants will be calculated, as well as which
contributions to the total spin--spin coupling constants are to be
calculated.
\end{list}

\section{Hyperfine Coupling Tensors}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item B.Fernandez, P.J{\o}rgensen, J.Byberg, J.Olsen, T.Helgaker, and
H.J.Aa.Jensen. \newblock {\em J.Chem.Phys.}, {\bf
97},\hspace{0.25em}3412, (1992).
\item Solvent effects: B.Fernandez, O.Christiansen, O.Bludsky,
P.J{\o}rgensen, K.V. Mikkelsen. \newblock {\em J.Chem.Phys.}, {\bf
104},\hspace{0.25em}629, (1996).
\item DFT: Z.Rinkevicius, L.Telyatnyk, O.Vahtras and H.{\AA}gren.
\newblock {\em J.Chem.Phys.}, {\bf 121},\hspace{0.25em} 7614 (2004);
Z. Rinkevicius, K. J. de Almeida and O. Vahtras, 
\newblock {\em J.Chem.Phys.}, {\bf 129},\hspace{0.25em} 64109 (2008)
\end{list}
}}
\end{center}

    The calculation of hyperfine coupling\index{hyperfine
coupling} tensors (in vacuum or in
solution) is invoked by the keyword \Sec{ESR} or keyword \Sec{HFC} in the \Sec{*RESPONSE}
input module. Thus a complete input file for the calculation of
hyperfine coupling tensors will be using ESR keyword:

\begin{verbatim}
**DALTON INPUT
.RUN RESPONSE
**INTEGRALS
.FC
.SD
**WAVE FUNCTIONS
.HF
**RESPON
.TRPFLG
*ESR
.ATOMS
 2
 1 2
.FCCALC
.SDCALC
.MAXIT
   30
**END OF DALTON INPUT
\end{verbatim}

    Alternatively at DFT level hyperfine coupling tensor can be computed using HFC keyword:

 \begin{verbatim}
**DALTON INPUT
.RUN RESPONSE
**INTEGRALS
.MNF-SO
**WAVE FUNCTIONS
.DFT
B3LYP
**RESPON
.TRPFLG
*HFC
.HFC-FC
.HFC-SD 
.HFC-SO
**END OF DALTON INPUT
\end{verbatim}
    
    This will invoke the calculation of hyperfine
coupling\index{hyperfine coupling} tensors
using the Restricted-Unrestricted\index{restricted-unrestricted method}
methodology~\cite{bfpjjbjothhjajjcp97}. In this approach, the
unperturbed molecular system is described with a spin-restricted MCSCF
wave function or spin-restricted Kohn--Sham DFT, and when the perturbation---Fermi Contact\index{Fermi
contact} or Spin Dipole\index{spin-dipole}
operators---is turned on, the wave function spin relaxes and all
first-order molecular properties are evaluated as the sum of the
conventional average value term and a relaxation term that includes
the response of the wave function to the perturbations.

    The selection of a flexible atomic orbital basis set is decisive
in these calculations. Dunning's cc-pVTZ or Widmark's basis sets with some
functions uncontracted, and one or two sets of diffuse functions and
several tight $s$ functions added have been shown to provide accurate
hyperfine coupling tensors~\cite{bfpjcpl232}.

    If more close control of the different parts of the calculation
of hyperfine coupling tensors is wanted, we refer the reader to the
sections describing the options available.

\section{Electronic g-tensors}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item ROHF and MCSCF: O.Vahtras, B.  Minaev and H.{\AA}gren
\newblock {\em Chem.Phys.Lett.}, {\bf
281},\hspace{0.25em}186, (1997).
\item DFT: Z.Rinkevicius, L.Telyatnyk, P.Sa{\l}ek, O.Vahtras and H.{\AA}gren.
\newblock {\em J.Chem.Phys.}, {\bf 119
},\hspace{0.25em}10489, (2003).
\end{list}
}}
\end{center}

The calculation of electronic g-tensors\index{g-tensor} is invoked
with the keyword \Key{G-TENSOR} in the
\Sec{ESR} section of the \Sec{*RESPONSE} input module

\begin{verbatim}
**DALTON INPUT
.RUN RESPONSE
**WAVE FUNCTIONS
.HARTREE-FOCK
**RESPON
*ESR
.G-TENSOR
**END OF DALTON INPUT
\end{verbatim}
which gives by default all contributions to the g-tensor to second order in
the fine-structure parameter. Keywords following the \Key{G-TENSOR} keyword
will be interpreted as g-tensor options, which are defined in section
\ref{sec:g-tensor}

\section{Zero field splitting}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item ROHF and MCSCF: O.Vahtras, O.Loboda, B.Minaev, H.{\AA}gren and K.Ruud.
\newblock {\em Chem.Phys.}, {\bf
279},\hspace{0.25em}133, (2002).
\end{list}
}}
\end{center}
The calculation of the zero-field splitting is invoked
with the keyword \Key{ZFS} in the
\Sec{ESR} section of the \Sec{*RESPONSE} input module
\begin{verbatim}
**DALTON INPUT
.RUN RESPONSE
**WAVE FUNCTIONS
.HARTREE-FOCK
**RESPON
*ESR
.ZFS
**END OF DALTON INPUT
\end{verbatim}
Note that only the first-order, two-electron, electronic spin--spin contribution
is implemented.

\section{CTOCD-DZ calculations}\label{sec:ctocd}

The \dalton\ program can be used to perform calculations of the magnetic
properties using the Continuous Transformation of the Origin of the Current Density
approach (CTOCD) \index{CTOCD-DZ}. Setting the diamagnetic contribution
to the current density zero, one obtains fully analytical solutions via equations
in closed form for several magnetic properties.


In the present version of \dalton, the following properties can be computed by
the CTOCD-DZ approach:

\begin{center}
\begin{itemize}{}{}
\item magnetizability\index{magnetizability}
\item nuclear magnetic shielding constant\index{nuclear shielding}
\item shielding polarizability\index{shielding polarizability}
\item hypermagnetizability\index{hypermagnetizability}
\end{itemize}
\end{center}
the last two properties have to be calculated as quadratic response functions as described
in Chapter~\ref{ch:rspchap}.

\subsection{General considerations}\label{sec:ctocdgeneral}

The CTOCD-DZ approach is competitive with other methods when the dimension
of the basis set is not too small, both for magnetizabilities and
shieldings ~\cite{ctocd}. However, for small basis sets the results can be
very unreliable. A good basis set for CTOCD-DZ nuclear magnetic shielding
calculations, both at the SCF and the correlated level, is the aug-cc-pCVTZ-CTOCD-uc
basis set (Ref.~\cite{ctocd}), derived from the aug-cc-pVTZ basis set.
This basis set is included in the \dalton\ basis set library.

In SCF calculations, the convergence toward the HF limit is slower
than when employing London Orbitals since in the CTOCD-DZ expressions for
the magnetic properties (nuclear magnetic shieldings and magnetizabilities)
the diamagnetic terms also depend on the first order perturbed density matrix.

On the other hand, the CTOCD scheme does not only fulfill the requirement of
translational invariance of the calculated magnetic properties but also
guarantees current-charge conservation which is not the case for methods using
London Orbitals. In the case of molecules with a vanishing electric dipole
moment, CTOCD magnetic susceptibilities are origin independent and the
continuity equation is automatically satisfied.

At the present it is possible to obtain CTOCD-DZ magnetizabilities and
nuclear magnetic shieldings with SCF and MCSCF wave functions as well
as with the SOPPA, SOPPA(CC2) and SOPPA(CCSD) methods via the
\Sec{*PROPERTIES} or \Sec{*RESPONSE} input modules. Is also possible to
compute these properties using various CC wave functions. Finally is
possible to use the quadratic response functions to compute
hypermagnetizabilities and shieldings polarizabilities for SCF, MCSCF
and CC wave functions.

Using the \Sec{*RESPONSE} input module, one has to be sure that the
calculations of the diamagnetic and paramagnetic contributions are both
carried out with the gauge origin set at the same positions, since only
the full property and not the diamagnetic or paramagnetic contributions
are gauge origin independent.

For calculations of nuclear magnetic shieldings (and shielding
polarizabilities) using symmetry, the gauge origin has to be placed at the
center of mass, otherwise \dalton\ will give wrong results! This is the
default choice of gauge origin. Nuclear magnetic
shielding calculations with the gauge origin set at the respective atoms can
only be carried without symmetry and by setting the gauge origin on that atom
in the **INTEGRAL section.

\subsection{Input description}\label{sec:ctocdinput}

\begin{center}
\fbox{
\parbox[h][\height][l]{12cm}{
\small
\noindent
{\bf Reference literature:}
\begin{list}{}{}
\item General reference: P.~Lazzeretti, M.~Malagoli and R.~Zanasi.
\newblock {\em Chem.~Phys.~Lett.}, {\bf 220},\hspace{0.25em} 299 (1994)
\item General reference: P.~Lazzeretti
\newblock {\em Prog.~Nucl.~Mag.~Res.~Spec.}, {\bf 220},\hspace{0.25em} 1--88
(2000)
\item  SOPPA and SOPPA(CCSD):
A.~Ligabue, S.~P.~A. Sauer and P.~Lazzeretti
\newblock {\em J.Chem.Phys.}, {\bf 118},\hspace{0.25em}6830, (2003).
\item DFT and CCSD:
A.~Ligabue, S.~P.~A. Sauer and P.~Lazzeretti
\newblock {\em J.Chem.Phys.}, {\bf 126},\hspace{0.25em}154111, (2007).
\item CC3:
I.~G.~Cuesta, J.~S{\'a}nchez, A.~M.~J.~S{\'a}nchez~de~Mer{\'a}s, F.~Pawlowski
 and P.~Lazzeretti,
\newblock {\em Phys.Chem.Chem.Phys.}, {\bf 12},\hspace{0.25em}6163, (2010).
\end{list}
}}
\end{center}

The input file for a CTOCD-DZ calculation of the magnetizability and
the nuclear magnetic shieldings will be:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
**PROPERTIES
.CTOCD
.MAGNET
.SHIELD
**END OF DALTON INPUT
\end{verbatim}
whereas for the same calculation at SOPPA level it will be:

\begin{verbatim}
**DALTON INPUT
.RUN PROPERTIES
**WAVE FUNCTIONS
.HF
.MP2
**PROPERTIES
.SOPPA
.CTOCD
.MAGNET
.SHIELD
**END OF DALTON INPUT
\end{verbatim}


%SPAS: 15-5-2011: this is no longer necessary as there is a nice keyword in the CC input
%\begin{verbatim}
%**DALTON INPUT
%.RUN WAVE FUNCTIONS
%**INTEGRALS
%.RANGMO
%.DIPVEL
%**WAVE FUNCTIONS
%.CC
%*CC INPUT
%.CCS
%.CCSD
%*CCLR
%.OPERAT
%YDIPVEL ZXRANG
%ZDIPVEL YXRANG
%ZDIPVEL ZXRANG
%XDIPVEL YXRANG
%XDIPVEL ZXRANG
%YDIPVEL YXRANG
%YDIPVEL ZYRANG
%ZDIPVEL YYRANG
%ZDIPVEL ZYRANG
%XDIPVEL YYRANG
%XDIPVEL ZYRANG
%YDIPVEL YYRANG
%YDIPVEL ZZRANG
%ZDIPVEL YZRANG
%ZDIPVEL ZZRANG
%XDIPVEL YZRANG
%XDIPVEL ZZRANG
%YDIPVEL YZRANG
%**END OF DALTON INPUT
%\end{verbatim}

%The value for each component of the CTOCD-DZ diamagnetic contribution to the
%magnetizability can then be obtained as:
%\begin{center}
%$\chi_{\alpha\beta}^{\Delta} = \epsilon_{\beta\lambda\mu}
%<< \hat{p}_{\lambda} ; \hat{r_O}_{\mu}\hat{L}_{\alpha} >>$
%\end{center}
%where $\hat{r_O}_{\mu}\hat{L}_{\alpha}$ are the $\mu\alpha$RANG operators.


Coupled cluster calculations of CTOCD-DZ magnetizabilities
~\cite{pccpcctocd} and shielding tensors ~\cite{spas073, pccpcctocd}
can be invoked with the keywords \Key{CTOSUS} and \Key{CTOSHI},
respectively, in the \Sec{CCLR} section of the \Sec{CC INP} input. The
needed integrals must be provided by the user in the \Sec{*INTEGRAL}
input module. All non-zero necessary response functions will be
generated and adequately coupled to build the magnetizabilty or nuclear
magnetic shielding tensors. Note that some null response functions may
be actually computed when the full symmetry point group is represented
by one of its subgroups (For instance, D$_{\infty h}$ represented by
D$_{2h}$). Then, a CCSD calculation of the nuclear magnetic shileding
tensors for all the symmetry independent atoms may be carried out with
the following input


\begin{verbatim}
**DALTON INPUT
.RUN WAVE FUNCTIONS
**INTEGRAL
.DIPVEL
.ANGMOM
.RPSO
.PSO
**WAVE FUNCTIONS
.CC
*SCF INPUT
.THRESH
 1.0d-8
*CC INPUT
.CCSD
.THRENR
 1.0d-8
.THRLEQ
 1.0d-6
*CCLR
.CTOSHI
**END OF DALTON INPUT
\end{verbatim}



Input examples for shieldings and shielding polarizabilities can be found in
the test directory.

For \Sec{*RESPONSE} calculations of these properties the integrals needed in
the \Sec{*INTEGRALS} section are .DIPVEL and .RANGMO for magnetizability, and .DIPVEL and .RPSO for
nuclear magnetic shieldings.
